<?php
declare (strict_types = 1);

namespace app\admin\validate;

use think\Validate;

class Tool extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        "toolName" => "require|max:25",
        "toolIntro" => "require",
        "toollabel" => "require",
        "toolHref" => "require|url"
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        "toolName.require" => "名称不能为空",
        "toolName.max" => "名称不能超过25个字符",
        "toolIntro.require" => "简介不能为空",
        "toollabel.require" => "标签不能为空",
        "toolHref.require" => "链接不能为空",
        "toolHref.url" => "链接格式不正确"
    ];

}
